var LoginHanlder=function () {

}

LoginHanlder.prototype.listernLoginRequest=function () {
    $("#submit-btn").on("click",function (event) {
        event.preventDefault();
        var email=$("input[name='email']").val();
        var password=$("input[name='password']").val();
        var remember=$("input[name='remember']").prop("checked");
        console.log(email,password,remember);
        zlajax.post({
            url:'/login/',
            data:{
                email,
                password,
                'remember':remember?1:0
            },
            success:function (result) {
                if(result['code']==200){
                    window.location='/';
                }else{
                    alert(result['message']);
                }
            }
        })
    })
}

LoginHanlder.prototype.run=function () {
    this.listernLoginRequest();
}


$(function () {
    var handler=new LoginHanlder();
    handler.run();
})